from rest_framework import serializers

from apps.goods.models import SpecificationOption, SPU


##规格表里面 获取选项表的管理
class SpecsOptinosSerializer(serializers.ModelSerializer):
    spec = serializers.StringRelatedField(read_only=True)
    spec_id = serializers.IntegerField()
    class Meta:
        model = SpecificationOption
        fields = ['id','value','spec','spec_id']


#简单的获取品牌的信息
class GoodsSpecsSimpleSerializer(serializers.Serializer):
    id = serializers.IntegerField()
    name = serializers.CharField()